//
//  TroopAction.cpp
//  fingeradvanture
//
//  Created by shuaibincheng on 16/5/21.
//
//
#include "TroopForm.hpp"
#include "TroopAction.hpp"
#include "TranslationAsGroupAction.hpp"
#include "OddMoveEvenStillAction.hpp"
#include "CrossFormAction.hpp"
#include "CircleFormAction.hpp"

TroopAction::TroopAction(int num)
{
    numOfMonster = num;
    form = NULL;
}

void TroopAction::train(const Vector<cocos2d::Node *> &monsters)
{
    //子类需要实现
}

TroopAction *TroopAction::getActionByType(TroopActionStyle type, int numOfMonster)
{
    switch (type) {
        case TYPE_TRANSLATIONASGROUP:
            return new TranslationAsGroupAction(numOfMonster);
        case TYPE_ODDMOVEEVENSTILL:
            return new OddMoveEvenStillAction(numOfMonster);
        case TYPE_CROSSFORM:
            return new CrossFormAction(numOfMonster);
        case TYPE_CIRCLEFORM:
            return new CircleFormAction(numOfMonster);
        default:
            return NULL;
    }
}